import { useEffect } from "react";

function BlogItem(props) {
    useEffect(() => {
        console.log("componentDidMount");

        return () => {
            console.log("componentDidUnMount")
        }
    }, []);

    return (
        <li>
            <span><input type="checkbox" checked={props.checked} onChange={(e)=>{props.sendChecked(e.target.checked, props.index)}} /></span>
            <span>{props.title}</span>
            <span>{props.author}</span>
            <span>{props.date}</span>
        </li>
    )
}

export default BlogItem;
/**
 * 无状态组件
 */